package com.windfone.service.impl;

import java.util.List;

import com.windfone.dao.MemberDao;
import com.windfone.model.Member;
import com.windfone.model.MemberDetail;
import com.windfone.model.Orderhistory;
import com.windfone.service.MemberService;

public class MemberServiceImpl implements MemberService {
	private MemberDao memberDao;
	public void setMemberDao(MemberDao memberDao) {
		this.memberDao = memberDao;
	}

	public int addMember(Member bean) {
		return memberDao.addMember(bean);
	}

	public int updateMember(Member bean) {
		return memberDao.updateMember(bean);
	}

	public int deleteMember(int key) {
		return memberDao.deleteMember(key);
	}

	public int addMemberDetail(MemberDetail bean) {
		return memberDao.addMemberDetail(bean);
	}

	public int updateMemberDetail(MemberDetail bean) {
		return memberDao.updateMemberDetail(bean);
	}

	public int deleteMemberDetail(int key) {
		return memberDao.deleteMemberDetail(key);
	}

	public List<Member> getMembers(int beginRecord, String whereCondition) {
		return memberDao.getMembers(beginRecord, whereCondition);
	}

	public int getAllRecorderNumber(String whereCondition) {
		return memberDao.getAllRecorderNumber(whereCondition);
	}

	public int deleteMemberDetailByMemeberId(int memberId) {
		return memberDao.deleteMemberDetailByMemeberId(memberId);
	}

	public Member getMemberByKey(int memberId) {
		return memberDao.getMemberByKey(memberId);
	}

	public MemberDetail getMemberDetailByKey(int memberId) {
		return memberDao.getMemberDetailByKey(memberId);
	}

	public boolean checkMember(Member bean) {
		return memberDao.checkMember( bean );
	}
	public boolean checkMemberBypwd(Member bean) {
		return memberDao.checkMemberBypwd( bean );
	}

	public int addRegisterUser(Member m) {
		return memberDao.addRegisterUser(m);
	}

	public int addRegisterDetailUser(MemberDetail m) {
		return memberDao.addRegisterDetailUser(m);
	}

	public Member getMemberByLoginName(Member bean) {
		return memberDao.getMemberByLoginName(bean);
	}

	public Member loginByMobile(String loginName, String password) {
		return memberDao.loginByMobile(loginName,password);
	}

	public Member loginByLoginName(String loginName, String password) {
		return memberDao.loginByLoginName( loginName,  password);
	}

	public int addOrderHistory(Orderhistory bean) {
		return memberDao.addOrderHistory(bean);
	}

	public int updateOrderHistory(Orderhistory bean) {
		return memberDao.updateOrderHistory(bean);
	}

	public int deleOrderHistory(Orderhistory bean) {
		return memberDao.deleOrderHistory(bean);
	}

	public List<Orderhistory> listOrderHistoryByUserId(int userId) {
		return memberDao.listOrderHistoryByUserId(userId);
	}

	public Orderhistory getOrderHistoryById(int purchaseHistoryId) {
		return memberDao.getOrderHistoryById( purchaseHistoryId );
	}

	public long addMemberGetReturnKey(Member bean) {
		return memberDao.addMemberGetReturnKey(bean);
	}

	public Member checkMemberByCardId(Member bean) {
		return memberDao.checkMemberByCardId(bean);
	}

	public int updateLastLogin(Member memberBean) {
		return memberDao.updateLastLogin(memberBean);
	}

	public int updateMemberLevl(Member bean) {
		return memberDao.updateMemberLevl(bean);
	}


}
